<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Document</title>
</head>
<body>
    <h1>请登录</h1>
    <div>
        <form action="" method="post">
            <p>
                登录名： <input type="text" id="Name"/>
            </p>
            <p>
                密码： <input type="password" id="Pass"/>
            </p>
            <p>
                <input type="button" id="login" value="登陆"/>
            </p>
        </form>
    </div>
    <script type="text/javascript" src="/jquery-1.11.3.min.js"></script>
    <script type="text/javascript">
        $("#login").click(function(){
            $.post("/dologin",{
                "Name" : $("#Name").val(),
                "Pass" : $("#Pass").val()
            },function(result){
                if(result == "1"){
                    alert("登录成功你最帅");
                }else if(result == "-2"){
                    alert("丑八怪你不存在");
                }else if(result == "-1"){
                    alert("密码错了丑八怪");
                }
            })
        });
    </script>
</body>
</html>